package com.sdgakj.utils;

import java.io.File;

import net.coobird.thumbnailator.Thumbnails;

public class PictureUtil {

	public static Integer resizePicture(String srcPath, String destPath, int width, int height) {
		Integer result = 0;
		try {
			Thumbnails.of(new File(srcPath)).outputQuality(1.0d).forceSize(width, height).toFile(new File(destPath));
		} catch (Exception e) {
			e.printStackTrace();
			result = -1;
		}
		return result;
	}

}
